package Config

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	Mysql    Mysql
	Redis    Redis
	Validate Validate
}

type Mysql struct {
	User     string
	Password string
	Host     string
	Port     string
	Database string
}

type Redis struct {
	Password string
	Host     string
	Port     string
}

type Validate struct {
	ID  string
	Key string
}

var Config AppConfig

func ConfigInit() {
	viper.SetConfigFile("../Config/appconfig.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Config)
	fmt.Println(Config)
}
